// $ANTLR 3.2 Sep 23, 2009 12:02:23 P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g 2010-12-16 20:06:41

// The variable 'variable' is assigned but its value is never used.
#pragma warning disable 168, 219
// Unreachable code detected.
#pragma warning disable 162


	using System.Collections.Generic;


using System;
using Antlr.Runtime;
using IList 		= System.Collections.IList;
using ArrayList 	= System.Collections.ArrayList;
using Stack 		= Antlr.Runtime.Collections.StackList;


public partial class testParser : Parser
{
    public static readonly string[] tokenNames = new string[] 
	{
        "<invalid>", 
		"<EOR>", 
		"<DOWN>", 
		"<UP>", 
		"Write", 
		"Publish", 
		"ID", 
		"Publisher", 
		"Author", 
		"Plural", 
		"Book", 
		"Who", 
		"WS", 
		"' '", 
		"'duoc '", 
		"'bang '", 
		"'tieng '", 
		"'ngon ngu '", 
		"'nao'", 
		"'gi'", 
		"'truoc nam '", 
		"'trong nam '", 
		"'sau nam '", 
		"'nao '", 
		"'da '", 
		"'tac pham '"
    };

    public const int Book = 10;
    public const int Publish = 5;
    public const int Author = 8;
    public const int T__25 = 25;
    public const int T__24 = 24;
    public const int T__23 = 23;
    public const int T__22 = 22;
    public const int T__21 = 21;
    public const int T__20 = 20;
    public const int Who = 11;
    public const int Write = 4;
    public const int ID = 6;
    public const int EOF = -1;
    public const int Plural = 9;
    public const int T__19 = 19;
    public const int WS = 12;
    public const int T__16 = 16;
    public const int T__15 = 15;
    public const int T__18 = 18;
    public const int T__17 = 17;
    public const int T__14 = 14;
    public const int T__13 = 13;
    public const int Publisher = 7;

    // delegates
    // delegators



        public testParser(ITokenStream input)
    		: this(input, new RecognizerSharedState()) {
        }

        public testParser(ITokenStream input, RecognizerSharedState state)
    		: base(input, state) {
            InitializeCyclicDFAs();

             
        }
        

    override public string[] TokenNames {
		get { return testParser.tokenNames; }
    }

    override public string GrammarFileName {
		get { return "P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g"; }
    }



    	protected override Object RecoverFromMismatchedToken(IIntStream input, int ttype, BitSet follow){
    		throw new MismatchedTokenException(); return null;
    	}

    	public override Object RecoverFromMismatchedSet(IIntStream input, RecognitionException e, BitSet follow){
    		throw new MismatchedSetException(); return null;
    	}



    // $ANTLR start "query"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:33:1: query returns [String result] : (name= dang1 | name= dang2 | name= dang3 | name= dang4 | name= dang5 );
    public String query() // throws RecognitionException [1]
    {   
        String result = default(String);

        String name = default(String);


        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:33:29: (name= dang1 | name= dang2 | name= dang3 | name= dang4 | name= dang5 )
            int alt1 = 5;
            switch ( input.LA(1) ) 
            {
            case Who:
            	{
                alt1 = 1;
                }
                break;
            case Author:
            	{
                alt1 = 2;
                }
                break;
            case Publisher:
            	{
                alt1 = 3;
                }
                break;
            case Plural:
            	{
                alt1 = 4;
                }
                break;
            case 25:
            	{
                int LA1_5 = input.LA(2);

                if ( (LA1_5 == ID) )
                {
                    alt1 = 5;
                }
                else if ( (LA1_5 == Publish) )
                {
                    alt1 = 4;
                }
                else 
                {
                    NoViableAltException nvae_d1s5 =
                        new NoViableAltException("", 1, 5, input);

                    throw nvae_d1s5;
                }
                }
                break;
            case Book:
            	{
                int LA1_6 = input.LA(2);

                if ( (LA1_6 == ID) )
                {
                    alt1 = 5;
                }
                else if ( (LA1_6 == Publish) )
                {
                    alt1 = 4;
                }
                else 
                {
                    NoViableAltException nvae_d1s6 =
                        new NoViableAltException("", 1, 6, input);

                    throw nvae_d1s6;
                }
                }
                break;
            	default:
            	    NoViableAltException nvae_d1s0 =
            	        new NoViableAltException("", 1, 0, input);

            	    throw nvae_d1s0;
            }

            switch (alt1) 
            {
                case 1 :
                    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:34:2: name= dang1
                    {
                    	PushFollow(FOLLOW_dang1_in_query52);
                    	name = dang1();
                    	state.followingStackPointer--;


                    				if (name!=null) result = "SELECT * FROM book WHERE `_ten_sach` LIKE '%" + name + "%'" ; else result=null;
                    			

                    }
                    break;
                case 2 :
                    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:38:2: name= dang2
                    {
                    	PushFollow(FOLLOW_dang2_in_query62);
                    	name = dang2();
                    	state.followingStackPointer--;


                    			if (name!=null) result = "SELECT * FROM book WHERE `_tac_gia` LIKE '%" + name + "%'" ; else result=null;
                    		

                    }
                    break;
                case 3 :
                    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:43:2: name= dang3
                    {
                    	PushFollow(FOLLOW_dang3_in_query74);
                    	name = dang3();
                    	state.followingStackPointer--;


                    			if (name!=null) result = "SELECT * FROM book WHERE `_ten_sach` LIKE '%" + name + "%'" ; else result=null;
                    		

                    }
                    break;
                case 4 :
                    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:48:2: name= dang4
                    {
                    	PushFollow(FOLLOW_dang4_in_query87);
                    	name = dang4();
                    	state.followingStackPointer--;


                    			if (name!=null) result = "SELECT * FROM book WHERE `nam` " + name  ; else result=null;
                    		

                    }
                    break;
                case 5 :
                    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:53:2: name= dang5
                    {
                    	PushFollow(FOLLOW_dang5_in_query100);
                    	name = dang5();
                    	state.followingStackPointer--;


                    			if (name!=null) result = "SELECT * FROM book WHERE `_ten_sach` LIKE '%" + name + "%'" ; else result=null;
                    		

                    }
                    break;

            }
        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return result;
    }
    // $ANTLR end "query"


    // $ANTLR start "dang5"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:60:1: dang5 returns [String result] : dang1o a= str ' ' ( 'duoc ' )? Write 'bang ' ( 'tieng ' | 'ngon ngu ' ) ( 'nao' | 'gi' ) ;
    public String dang5() // throws RecognitionException [1]
    {   
        String result = default(String);

        String a = default(String);


        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:60:29: ( dang1o a= str ' ' ( 'duoc ' )? Write 'bang ' ( 'tieng ' | 'ngon ngu ' ) ( 'nao' | 'gi' ) )
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:60:31: dang1o a= str ' ' ( 'duoc ' )? Write 'bang ' ( 'tieng ' | 'ngon ngu ' ) ( 'nao' | 'gi' )
            {
            	PushFollow(FOLLOW_dang1o_in_dang5117);
            	dang1o();
            	state.followingStackPointer--;

            	PushFollow(FOLLOW_str_in_dang5121);
            	a = str();
            	state.followingStackPointer--;

            	Match(input,13,FOLLOW_13_in_dang5123); 
            	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:60:48: ( 'duoc ' )?
            	int alt2 = 2;
            	int LA2_0 = input.LA(1);

            	if ( (LA2_0 == 14) )
            	{
            	    alt2 = 1;
            	}
            	switch (alt2) 
            	{
            	    case 1 :
            	        // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:60:48: 'duoc '
            	        {
            	        	Match(input,14,FOLLOW_14_in_dang5125); 

            	        }
            	        break;

            	}

            	Match(input,Write,FOLLOW_Write_in_dang5128); 
            	Match(input,15,FOLLOW_15_in_dang5130); 
            	if ( (input.LA(1) >= 16 && input.LA(1) <= 17) ) 
            	{
            	    input.Consume();
            	    state.errorRecovery = false;
            	}
            	else 
            	{
            	    MismatchedSetException mse = new MismatchedSetException(null,input);
            	    throw mse;
            	}

            	if ( (input.LA(1) >= 18 && input.LA(1) <= 19) ) 
            	{
            	    input.Consume();
            	    state.errorRecovery = false;
            	}
            	else 
            	{
            	    MismatchedSetException mse = new MismatchedSetException(null,input);
            	    throw mse;
            	}

            	result = a;

            }

        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return result;
    }
    // $ANTLR end "dang5"


    // $ANTLR start "dang4"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:65:1: dang4 returns [String result] : dang2o Publish a= dang4dt ;
    public String dang4() // throws RecognitionException [1]
    {   
        String result = default(String);

        String a = default(String);


        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:65:29: ( dang2o Publish a= dang4dt )
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:65:30: dang2o Publish a= dang4dt
            {
            	PushFollow(FOLLOW_dang2o_in_dang4161);
            	dang2o();
            	state.followingStackPointer--;

            	Match(input,Publish,FOLLOW_Publish_in_dang4163); 
            	PushFollow(FOLLOW_dang4dt_in_dang4167);
            	a = dang4dt();
            	state.followingStackPointer--;

            	result = a;

            }

        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return result;
    }
    // $ANTLR end "dang4"


    // $ANTLR start "dang4dt"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:66:1: dang4dt returns [String result] : ( ( 'truoc nam ' a= ID ) | ( 'trong nam ' a= ID ) | ( 'sau nam ' a= ID ) );
    public String dang4dt() // throws RecognitionException [1]
    {   
        String result = default(String);

        IToken a = null;

        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:67:2: ( ( 'truoc nam ' a= ID ) | ( 'trong nam ' a= ID ) | ( 'sau nam ' a= ID ) )
            int alt3 = 3;
            switch ( input.LA(1) ) 
            {
            case 20:
            	{
                alt3 = 1;
                }
                break;
            case 21:
            	{
                alt3 = 2;
                }
                break;
            case 22:
            	{
                alt3 = 3;
                }
                break;
            	default:
            	    NoViableAltException nvae_d3s0 =
            	        new NoViableAltException("", 3, 0, input);

            	    throw nvae_d3s0;
            }

            switch (alt3) 
            {
                case 1 :
                    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:67:4: ( 'truoc nam ' a= ID )
                    {
                    	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:67:4: ( 'truoc nam ' a= ID )
                    	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:67:5: 'truoc nam ' a= ID
                    	{
                    		Match(input,20,FOLLOW_20_in_dang4dt183); 
                    		a=(IToken)Match(input,ID,FOLLOW_ID_in_dang4dt187); 
                    		result= "<" + ((a != null) ? a.Text : null);

                    	}


                    }
                    break;
                case 2 :
                    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:68:7: ( 'trong nam ' a= ID )
                    {
                    	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:68:7: ( 'trong nam ' a= ID )
                    	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:68:8: 'trong nam ' a= ID
                    	{
                    		Match(input,21,FOLLOW_21_in_dang4dt199); 
                    		a=(IToken)Match(input,ID,FOLLOW_ID_in_dang4dt203); 
                    		result= "=" + ((a != null) ? a.Text : null);

                    	}


                    }
                    break;
                case 3 :
                    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:69:7: ( 'sau nam ' a= ID )
                    {
                    	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:69:7: ( 'sau nam ' a= ID )
                    	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:69:8: 'sau nam ' a= ID
                    	{
                    		Match(input,22,FOLLOW_22_in_dang4dt215); 
                    		a=(IToken)Match(input,ID,FOLLOW_ID_in_dang4dt219); 
                    		result= ">" + ((a != null) ? a.Text : null);

                    	}


                    }
                    break;

            }
        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return result;
    }
    // $ANTLR end "dang4dt"


    // $ANTLR start "dang3"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:73:1: dang3 returns [String result] : dang3s ( dang1o )? bookName= str ;
    public String dang3() // throws RecognitionException [1]
    {   
        String result = default(String);

        String bookName = default(String);


        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:73:30: ( dang3s ( dang1o )? bookName= str )
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:73:32: dang3s ( dang1o )? bookName= str
            {
            	PushFollow(FOLLOW_dang3s_in_dang3236);
            	dang3s();
            	state.followingStackPointer--;

            	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:73:39: ( dang1o )?
            	int alt4 = 2;
            	int LA4_0 = input.LA(1);

            	if ( (LA4_0 == Book || LA4_0 == 25) )
            	{
            	    alt4 = 1;
            	}
            	switch (alt4) 
            	{
            	    case 1 :
            	        // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:73:39: dang1o
            	        {
            	        	PushFollow(FOLLOW_dang1o_in_dang3238);
            	        	dang1o();
            	        	state.followingStackPointer--;


            	        }
            	        break;

            	}

            	PushFollow(FOLLOW_str_in_dang3243);
            	bookName = str();
            	state.followingStackPointer--;

            	result = bookName ;

            }

        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return result;
    }
    // $ANTLR end "dang3"


    // $ANTLR start "dang3s"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:74:1: dang3s : ( ( Publisher 'nao ' ) ( 'da ' )? Publish ) ;
    public void dang3s() // throws RecognitionException [1]
    {   
        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:74:8: ( ( ( Publisher 'nao ' ) ( 'da ' )? Publish ) )
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:74:10: ( ( Publisher 'nao ' ) ( 'da ' )? Publish )
            {
            	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:74:10: ( ( Publisher 'nao ' ) ( 'da ' )? Publish )
            	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:74:11: ( Publisher 'nao ' ) ( 'da ' )? Publish
            	{
            		// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:74:11: ( Publisher 'nao ' )
            		// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:74:12: Publisher 'nao '
            		{
            			Match(input,Publisher,FOLLOW_Publisher_in_dang3s255); 
            			Match(input,23,FOLLOW_23_in_dang3s257); 

            		}

            		// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:74:30: ( 'da ' )?
            		int alt5 = 2;
            		int LA5_0 = input.LA(1);

            		if ( (LA5_0 == 24) )
            		{
            		    alt5 = 1;
            		}
            		switch (alt5) 
            		{
            		    case 1 :
            		        // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:74:31: 'da '
            		        {
            		        	Match(input,24,FOLLOW_24_in_dang3s261); 

            		        }
            		        break;

            		}

            		Match(input,Publish,FOLLOW_Publish_in_dang3s266); 

            	}


            }

        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return ;
    }
    // $ANTLR end "dang3s"


    // $ANTLR start "dang2"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:78:1: dang2 returns [String result] : a= dang2s dang2o ( 'nao' | 'gi' ) ;
    public String dang2() // throws RecognitionException [1]
    {   
        String result = default(String);

        String a = default(String);


        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:78:29: (a= dang2s dang2o ( 'nao' | 'gi' ) )
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:78:30: a= dang2s dang2o ( 'nao' | 'gi' )
            {
            	PushFollow(FOLLOW_dang2s_in_dang2281);
            	a = dang2s();
            	state.followingStackPointer--;

            	PushFollow(FOLLOW_dang2o_in_dang2284);
            	dang2o();
            	state.followingStackPointer--;

            	if ( (input.LA(1) >= 18 && input.LA(1) <= 19) ) 
            	{
            	    input.Consume();
            	    state.errorRecovery = false;
            	}
            	else 
            	{
            	    MismatchedSetException mse = new MismatchedSetException(null,input);
            	    throw mse;
            	}

            	result = a;

            }

        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return result;
    }
    // $ANTLR end "dang2"


    // $ANTLR start "dang2s"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:79:1: dang2s returns [String result] : Author authorName= str ' ' ( 'da ' )? Write ;
    public String dang2s() // throws RecognitionException [1]
    {   
        String result = default(String);

        String authorName = default(String);


        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:80:2: ( Author authorName= str ' ' ( 'da ' )? Write )
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:80:4: Author authorName= str ' ' ( 'da ' )? Write
            {
            	Match(input,Author,FOLLOW_Author_in_dang2s307); 
            	PushFollow(FOLLOW_str_in_dang2s311);
            	authorName = str();
            	state.followingStackPointer--;

            	Match(input,13,FOLLOW_13_in_dang2s313); 
            	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:80:30: ( 'da ' )?
            	int alt6 = 2;
            	int LA6_0 = input.LA(1);

            	if ( (LA6_0 == 24) )
            	{
            	    alt6 = 1;
            	}
            	switch (alt6) 
            	{
            	    case 1 :
            	        // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:80:31: 'da '
            	        {
            	        	Match(input,24,FOLLOW_24_in_dang2s316); 

            	        }
            	        break;

            	}

            	Match(input,Write,FOLLOW_Write_in_dang2s320); 
            	result=authorName;

            }

        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return result;
    }
    // $ANTLR end "dang2s"


    // $ANTLR start "dang2o"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:81:1: dang2o : ( Plural )? ( 'tac pham ' | ( Book ) ) ;
    public void dang2o() // throws RecognitionException [1]
    {   
        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:81:8: ( ( Plural )? ( 'tac pham ' | ( Book ) ) )
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:81:10: ( Plural )? ( 'tac pham ' | ( Book ) )
            {
            	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:81:10: ( Plural )?
            	int alt7 = 2;
            	int LA7_0 = input.LA(1);

            	if ( (LA7_0 == Plural) )
            	{
            	    alt7 = 1;
            	}
            	switch (alt7) 
            	{
            	    case 1 :
            	        // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:81:10: Plural
            	        {
            	        	Match(input,Plural,FOLLOW_Plural_in_dang2o329); 

            	        }
            	        break;

            	}

            	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:81:19: ( 'tac pham ' | ( Book ) )
            	int alt8 = 2;
            	int LA8_0 = input.LA(1);

            	if ( (LA8_0 == 25) )
            	{
            	    alt8 = 1;
            	}
            	else if ( (LA8_0 == Book) )
            	{
            	    alt8 = 2;
            	}
            	else 
            	{
            	    NoViableAltException nvae_d8s0 =
            	        new NoViableAltException("", 8, 0, input);

            	    throw nvae_d8s0;
            	}
            	switch (alt8) 
            	{
            	    case 1 :
            	        // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:81:20: 'tac pham '
            	        {
            	        	Match(input,25,FOLLOW_25_in_dang2o334); 

            	        }
            	        break;
            	    case 2 :
            	        // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:81:34: ( Book )
            	        {
            	        	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:81:34: ( Book )
            	        	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:81:36: Book
            	        	{
            	        		Match(input,Book,FOLLOW_Book_in_dang2o340); 

            	        	}


            	        }
            	        break;

            	}


            }

        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return ;
    }
    // $ANTLR end "dang2o"


    // $ANTLR start "dang1"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:84:1: dang1 returns [String result] : dang1s ( dang1o )? bookName= str ;
    public String dang1() // throws RecognitionException [1]
    {   
        String result = default(String);

        String bookName = default(String);


        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:84:30: ( dang1s ( dang1o )? bookName= str )
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:84:32: dang1s ( dang1o )? bookName= str
            {
            	PushFollow(FOLLOW_dang1s_in_dang1355);
            	dang1s();
            	state.followingStackPointer--;

            	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:84:39: ( dang1o )?
            	int alt9 = 2;
            	int LA9_0 = input.LA(1);

            	if ( (LA9_0 == Book || LA9_0 == 25) )
            	{
            	    alt9 = 1;
            	}
            	switch (alt9) 
            	{
            	    case 1 :
            	        // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:84:39: dang1o
            	        {
            	        	PushFollow(FOLLOW_dang1o_in_dang1357);
            	        	dang1o();
            	        	state.followingStackPointer--;


            	        }
            	        break;

            	}

            	PushFollow(FOLLOW_str_in_dang1362);
            	bookName = str();
            	state.followingStackPointer--;

            	result = bookName ;

            }

        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return result;
    }
    // $ANTLR end "dang1"


    // $ANTLR start "dang1s"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:85:1: dang1s : ( Who ( 'da ' )? Write ) ;
    public void dang1s() // throws RecognitionException [1]
    {   
        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:85:8: ( ( Who ( 'da ' )? Write ) )
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:85:10: ( Who ( 'da ' )? Write )
            {
            	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:85:10: ( Who ( 'da ' )? Write )
            	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:85:11: Who ( 'da ' )? Write
            	{
            		Match(input,Who,FOLLOW_Who_in_dang1s373); 
            		// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:85:15: ( 'da ' )?
            		int alt10 = 2;
            		int LA10_0 = input.LA(1);

            		if ( (LA10_0 == 24) )
            		{
            		    alt10 = 1;
            		}
            		switch (alt10) 
            		{
            		    case 1 :
            		        // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:85:16: 'da '
            		        {
            		        	Match(input,24,FOLLOW_24_in_dang1s376); 

            		        }
            		        break;

            		}

            		Match(input,Write,FOLLOW_Write_in_dang1s381); 

            	}


            }

        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return ;
    }
    // $ANTLR end "dang1s"


    // $ANTLR start "dang1o"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:86:1: dang1o : ( 'tac pham ' | ( Book ) );
    public void dang1o() // throws RecognitionException [1]
    {   
        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:86:8: ( 'tac pham ' | ( Book ) )
            int alt11 = 2;
            int LA11_0 = input.LA(1);

            if ( (LA11_0 == 25) )
            {
                alt11 = 1;
            }
            else if ( (LA11_0 == Book) )
            {
                alt11 = 2;
            }
            else 
            {
                NoViableAltException nvae_d11s0 =
                    new NoViableAltException("", 11, 0, input);

                throw nvae_d11s0;
            }
            switch (alt11) 
            {
                case 1 :
                    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:86:10: 'tac pham '
                    {
                    	Match(input,25,FOLLOW_25_in_dang1o390); 

                    }
                    break;
                case 2 :
                    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:86:24: ( Book )
                    {
                    	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:86:24: ( Book )
                    	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:86:26: Book
                    	{
                    		Match(input,Book,FOLLOW_Book_in_dang1o396); 

                    	}


                    }
                    break;

            }
        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return ;
    }
    // $ANTLR end "dang1o"


    // $ANTLR start "str"
    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:99:1: str returns [String result] : a= ID ( ' ' b= ID )* ;
    public String str() // throws RecognitionException [1]
    {   
        String result = default(String);

        IToken a = null;
        IToken b = null;

        try 
    	{
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:99:28: (a= ID ( ' ' b= ID )* )
            // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:99:32: a= ID ( ' ' b= ID )*
            {
            	a=(IToken)Match(input,ID,FOLLOW_ID_in_str542); 
            	String r ; r =((a != null) ? a.Text : null);
            	// P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:99:62: ( ' ' b= ID )*
            	do 
            	{
            	    int alt12 = 2;
            	    int LA12_0 = input.LA(1);

            	    if ( (LA12_0 == 13) )
            	    {
            	        int LA12_1 = input.LA(2);

            	        if ( (LA12_1 == ID) )
            	        {
            	            alt12 = 1;
            	        }


            	    }


            	    switch (alt12) 
            		{
            			case 1 :
            			    // P:\\Documents and Settings\\pntruongan\\My Documents\\Visual Studio 2010\\Projects\\ANTLR Question Demo\\ANTLR Question Demo\\ANTLR Question Demo\\antlrGenerated\\test.g:99:63: ' ' b= ID
            			    {
            			    	Match(input,13,FOLLOW_13_in_str547); 
            			    	b=(IToken)Match(input,ID,FOLLOW_ID_in_str551); 
            			    	 r+= " " + ((b != null) ? b.Text : null);

            			    }
            			    break;

            			default:
            			    goto loop12;
            	    }
            	} while (true);

            	loop12:
            		;	// Stops C# compiler whining that label 'loop12' has no statements

            	result = r;

            }

        }

        catch (RecognitionException e) {
        	throw e;
        }
        finally 
    	{
        }
        return result;
    }
    // $ANTLR end "str"

    // Delegated rules


	private void InitializeCyclicDFAs()
	{
	}

 

    public static readonly BitSet FOLLOW_dang1_in_query52 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_dang2_in_query62 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_dang3_in_query74 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_dang4_in_query87 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_dang5_in_query100 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_dang1o_in_dang5117 = new BitSet(new ulong[]{0x0000000000000040UL});
    public static readonly BitSet FOLLOW_str_in_dang5121 = new BitSet(new ulong[]{0x0000000000002000UL});
    public static readonly BitSet FOLLOW_13_in_dang5123 = new BitSet(new ulong[]{0x0000000000004010UL});
    public static readonly BitSet FOLLOW_14_in_dang5125 = new BitSet(new ulong[]{0x0000000000000010UL});
    public static readonly BitSet FOLLOW_Write_in_dang5128 = new BitSet(new ulong[]{0x0000000000008000UL});
    public static readonly BitSet FOLLOW_15_in_dang5130 = new BitSet(new ulong[]{0x0000000000030000UL});
    public static readonly BitSet FOLLOW_set_in_dang5132 = new BitSet(new ulong[]{0x00000000000C0000UL});
    public static readonly BitSet FOLLOW_set_in_dang5140 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_dang2o_in_dang4161 = new BitSet(new ulong[]{0x0000000000000020UL});
    public static readonly BitSet FOLLOW_Publish_in_dang4163 = new BitSet(new ulong[]{0x0000000000700000UL});
    public static readonly BitSet FOLLOW_dang4dt_in_dang4167 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_20_in_dang4dt183 = new BitSet(new ulong[]{0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_dang4dt187 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_21_in_dang4dt199 = new BitSet(new ulong[]{0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_dang4dt203 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_22_in_dang4dt215 = new BitSet(new ulong[]{0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_dang4dt219 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_dang3s_in_dang3236 = new BitSet(new ulong[]{0x0000000002000440UL});
    public static readonly BitSet FOLLOW_dang1o_in_dang3238 = new BitSet(new ulong[]{0x0000000000000040UL});
    public static readonly BitSet FOLLOW_str_in_dang3243 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_Publisher_in_dang3s255 = new BitSet(new ulong[]{0x0000000000800000UL});
    public static readonly BitSet FOLLOW_23_in_dang3s257 = new BitSet(new ulong[]{0x0000000001000020UL});
    public static readonly BitSet FOLLOW_24_in_dang3s261 = new BitSet(new ulong[]{0x0000000000000020UL});
    public static readonly BitSet FOLLOW_Publish_in_dang3s266 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_dang2s_in_dang2281 = new BitSet(new ulong[]{0x0000000002000600UL});
    public static readonly BitSet FOLLOW_dang2o_in_dang2284 = new BitSet(new ulong[]{0x00000000000C0000UL});
    public static readonly BitSet FOLLOW_set_in_dang2286 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_Author_in_dang2s307 = new BitSet(new ulong[]{0x0000000000000040UL});
    public static readonly BitSet FOLLOW_str_in_dang2s311 = new BitSet(new ulong[]{0x0000000000002000UL});
    public static readonly BitSet FOLLOW_13_in_dang2s313 = new BitSet(new ulong[]{0x0000000001000010UL});
    public static readonly BitSet FOLLOW_24_in_dang2s316 = new BitSet(new ulong[]{0x0000000000000010UL});
    public static readonly BitSet FOLLOW_Write_in_dang2s320 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_Plural_in_dang2o329 = new BitSet(new ulong[]{0x0000000002000400UL});
    public static readonly BitSet FOLLOW_25_in_dang2o334 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_Book_in_dang2o340 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_dang1s_in_dang1355 = new BitSet(new ulong[]{0x0000000002000440UL});
    public static readonly BitSet FOLLOW_dang1o_in_dang1357 = new BitSet(new ulong[]{0x0000000000000040UL});
    public static readonly BitSet FOLLOW_str_in_dang1362 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_Who_in_dang1s373 = new BitSet(new ulong[]{0x0000000001000010UL});
    public static readonly BitSet FOLLOW_24_in_dang1s376 = new BitSet(new ulong[]{0x0000000000000010UL});
    public static readonly BitSet FOLLOW_Write_in_dang1s381 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_25_in_dang1o390 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_Book_in_dang1o396 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_ID_in_str542 = new BitSet(new ulong[]{0x0000000000002002UL});
    public static readonly BitSet FOLLOW_13_in_str547 = new BitSet(new ulong[]{0x0000000000000040UL});
    public static readonly BitSet FOLLOW_ID_in_str551 = new BitSet(new ulong[]{0x0000000000002002UL});

}
